"""
@name : 流程控制作业
@author : yinbangyou
@projectname: tianlongbabu
"""

# ##用户验证
i = 0
while i <3:
    usrname = input("请输入用户名：")
    password = input("请输入密码：")
    if usrname == 'root' and password == '123456':
            print ("登陆成功")
            break
    else:
         print(f"登陆失败，您还剩{2-i}次机会")
         i += 1

else:
    print("三次机会已用完")

###千位分隔符
number = input("请输入数字：")
if number.isdigit():
    print("number --> {0:,}".format(int(number)))
else:
    print("你输入的不是数字")

# 儿童弹珠游戏
import random
randnum = bin(random.randrange(1,4095,1))[2:]
print("亮灯情况：{:0<13}".format(randnum))
danzhu = random.randrange(1,13,1)
if randnum[danzhu-1:danzhu] == '1' :
    print(f"你打到了第{danzhu}个灯\n游戏结果为Turn")
else:
    print("你没打中")
